def get_board(board_object: object = None, width: int = 0, height: int = 0):
    from copy import deepcopy
    return [[deepcopy(board_object) for _ in range(width)] for _ in range(height)]


def to_tri(x, y):
    a = (y+x) // 2
    b = -y
    c = (y-x) // 2
    return a, b, c


def to_hex(x, y):
    a = x
    b = y - (x - x % 2) // 2
    c = - x - y + (x - x % 2) // 2
    return a, b, c


def distance_quart(shape: int, x1: int, y1: int, x2: int, y2: int):

    match shape:
        case 3:
            a1, b1, c1 = to_tri(x1, y1)
            a2, b2, c2 = to_tri(x2, y2)
            return abs(a1 - a2) + abs(b1 - b2) + abs(c1 - c2)
        case 4:
            return abs(x1 - x2) + abs(y1 - y2)
        case 6:
            a1, b1, c1 = to_hex(x1, y1)
            a2, b2, c2 = to_hex(x2, y2)
            return (abs(a1 - a2) + abs(b1 - b2) + abs(c1 - c2))//2


def distance_max(shape: int, x1: int, y1: int, x2: int, y2: int):

    match shape:
        case 3:
            a1, b1, c1 = to_tri(x1, y1)
            a2, b2, c2 = to_tri(x2, y2)
            return max(abs(a1 - a2), abs(b1 - b2), abs(c1 - c2))
        case 4:
            return max(abs(x1 - x2), abs(y1 - y2))
        case 6:
            a1, b1, c1 = to_hex(x1, y1)
            a2, b2, c2 = to_hex(x2, y2)
            return (abs(a1 - a2) + abs(b1 - b2) + abs(c1 - c2))//2


if __name__ == "__main__":
    from itertools import product
    x0, y0 = 5, 5
    for y in range(11):
        for x in range(11):
            print(end=f"{distance_max(4, x, y, x0, y0)}")
        print()


